import requests
from config import url, headers_web


class Project:
    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_project(cls, url: str, headers=headers_web, params=None):
        """
        Summary:获取课程下的项目接口
        Description:1.云课堂老师端-项目量表配置使用
        :param url:
        :param headers:
        :param params:
        :return:
        """
        url = url + "/courseApi/v1/course/project"
        r = requests.get(url=url, headers=headers, params=params)
        return r

    @classmethod
    def post_standardduration(cls, url: str, headers=headers_web, params=None,json=None,paramspath=None):
        """
        Summary:修改项目标准时长接口
        Description:1.云课堂教师端-项目配置管理使用
        :param url:
        :param headers:
        :param params:
        :param json:
        :param paramspath
        :return:
        """
        url = url + f"/courseApi/v1/project/{paramspath}/standardduration"
        r = requests.post(url=url, headers=headers, params=params,json=json)
        return r

